/* This code was modified by Georges Hanna Fab Academy 2018, OUTPUT DEVICES The code was modified Based on the below code : https://www.digikey.ca/en/maker/projects/08a1813ffe6d43b0899f29d08f350547 */ const int sen=3; const int led=7; // variable which stores pin number void setup() { pinMode(led, OUTPUT); pinMode(sen, INPUT); } void loop() { int sensor_value = analogRead(sen); if (sensor_value < 10)// the point at which the state of LEDs change { digitalWrite(led, HIGH); //sets LEDs ON } else { digitalWrite(led,LOW); //Sets LEDs OFF } }